package com.applicationz;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.core.env.ConfigurableEnvironment;

/**
 * ClassName:ApplicationEnvironment
 * Package:com.applicationz
 *
 * @Date:2024/7/20 15:06
 * @Author:zxde
 */
@SpringBootApplication
public class ApplicationEnvironment {
    public static void main(String[] args) {
        ConfigurableApplicationContext context = SpringApplication.run(ApplicationResource.class);

        ConfigurableEnvironment environment = context.getEnvironment();
        String java_home = environment.getProperty("JAVA_HOME");
        System.out.println(java_home);


        System.out.println("--------------------");

        String property = environment.getProperty("spring.application.name");
        System.out.println(property);


    }
}
